

/*
*
* 对象实体类-json转model
*
* */


class CommentDto {
  int hasNext;
  int lastTime;
  int lastId;
  String lastIdStr;
  int lastScore;
  List list=[];
  int totalPage;
  int totalCount;

  CommentDto({this.hasNext, this.lastTime, this.lastId, this.lastIdStr,
      this.lastScore, this.list, this.totalPage, this.totalCount});

  CommentDto.fromJson(Map<String, dynamic> json) {
    hasNext = json["hasNext"];
    lastTime = json["lastTime"];
    lastId = json["lastId"];
    lastIdStr=json["lastIdStr"];
    lastScore = json["lastScore"];
    if (json["list"] != null) {
      json["list"].forEach((v) {
        if (v is ListModel) {
          list.add(v);
        } else {
          list.add(ListModel.fromJson(v));
        }
      });
    }
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["hasNext"] = hasNext;
    map["lastTime"] = lastTime;
    map["lastId"] = lastId;
    map["lastScore"] = lastScore;
    map["lastIdStr"] =lastIdStr;
    map["list"] = list;
    return map;
  }

  @override
  String toString() {
    return toJson().toString();
      // 'CommentDto{hasNexxt: $hasNext, lastTime: $lastTime, lastId: $lastId, lastStr: $lastIdStr, lastScore: $lastScore, list: $list, totalPage: $totalPage, tatalCount: $totalCount}';
  }
}

class ListModel{
  String cityCode;
  double longitude;
  double latitude;
  String address;
  int id;
  String idStr;
  int type;
  String content;
  List <PicUrls> picUrls=[];
  List <Videos> videos=[];
  List <AtUsers> atUsers=[];
  int createTime;
  int updateTime;
  int pushId;
  String name;
  int userInfoDto;
  String avatarUrl;
  List <TopIcs> topics=[];
  String topicsStr;
  String picUrlsStr;
  String videosStr;
  CourseDto courseDto;
  int commentCount;
  int laudCount;
  int shareCount;
  int readCount;
  int isFollow;
  int isLaud;
  List <LaudUserInfo> laudUserInfo=[];
  List <LaudUserInfos> laudUserInfos=[];
  List <Comments> comments=[];
  int dataState;
  int auditState;
  RecommendSourceDto recommendSourceDto;

  ListModel.fromJson(Map<String, dynamic> json) {
    cityCode = json["cityCode"];
    longitude = json["longitude"];
    latitude = json["latitude"];
    address=json["address"];
    id = json["id"];
    idStr = json["idStr"];
    type = json["type"];
    content = json["content"];
    createTime=json["createTime"];
    updateTime = json["updateTime"];
    pushId = json["pushId"];
    name = json["name"];
    userInfoDto = json["userInfoDto"];
    avatarUrl=json["avatarUrl"];
    topicsStr = json["topicsStr"];
    videosStr = json["videosStr"];
    commentCount = json["commentCount"];
    laudCount = json["laudCount"];
    shareCount=json["shareCount"];
    readCount = json["readCount"];
    isFollow = json["isFollow"];
    isLaud = json["isLaud"];
    dataState = json["dataState"];
    auditState=json["auditState"];

    if(json["picUrls"]!=null){
      json["picUrls"].forEach((v) {
        if (v is PicUrls) {
          picUrls.add(v);
        } else {
          picUrls.add(PicUrls.fromJson(v));
        }
      });
    }
    if(json["videos"]!=null){
      json["videos"].forEach((v) {
        if (v is Videos) {
          videos.add(v);
        } else {
          videos.add(Videos.fromJson(v));
        }
      });
    }

    if(json["atUsers"]!=null){
      json["atUsers"].forEach((v) {
        if (v is AtUsers) {
          atUsers.add(v);
        } else {
          atUsers.add(AtUsers.fromJson(v));
        }
      });
    }

    if(json["topics"]!=null) {
      json["topics"].forEach((v) {
        if (v is TopIcs) {
          topics.add(v);
        } else {
          topics.add(TopIcs.fromJson(v));
        }
      });
    }

    if(json["courseDto"]!=null) {
    }

    if(json["laudUserInfo"]!=null) {
      json["laudUserInfo"].forEach((v) {
        if (v is LaudUserInfo) {
          laudUserInfo.add(v);
        }
      });
    }

    if(json["laudUserInfos"]!=null) {
      json["laudUserInfos"].forEach((v) {
        if (v is LaudUserInfos) {
          laudUserInfos.add(v);
        } else {
          laudUserInfos.add(LaudUserInfos.fromJson(v));
        }
      });
    }

    if(json["comments"]!=null) {
      json["comments"].forEach((v) {
        if (v is Comments) {
          comments.add(v);
        } else {
          comments.add(Comments.fromJson(v));
        }
      });
    }


    if(json["recommendSourceDto"]!=null) {
      recommendSourceDto=RecommendSourceDto.fromJson(json["recommendSourceDto"]);

    }




  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["cityCode"]=cityCode;
    map["longitude"]=longitude;
    map["latitude"]=latitude;
    map["address"]=address;
    map["id"]=id;

     map["idStr"]=idStr;
     map["type"]=type;
     map["content"]=content;
     map["createTime"]=createTime;
     map["updateTime"]=updateTime;
     map["pushId"]=pushId;
     map["name"]=name;
     map["userInfoDto"]=userInfoDto;
     map["avatarUrl"]=avatarUrl;
     map["topicsStr"]=topicsStr;
     map["videosStr"]=videosStr;

     map["commentCount"]=commentCount;
     map["laudCount"]=laudCount;
     map["shareCount"]=shareCount;
     map["readCount"]=readCount;
     map["isFollow"]=isFollow;
     map["isLaud"]=isLaud;
     map["dataState"]=dataState;
     map["auditState"]=auditState;


    map["picUrls"]=picUrls;
    map["videos"]=videos;
    map["atUsers"]=atUsers;
    map["topics"]=topics;

    map["courseDto"]=courseDto;

    map["laudUserInfo"]=laudUserInfo;
    map["laudUserInfos"]=laudUserInfos;
    map["comments"]=comments;
    map["recommendSourceDto"]=recommendSourceDto;


    return map;
  }


  @override
  String toString() {
    return toJson().toString();
  }

  ListModel(
      this.cityCode,
      this.longitude,
      this.latitude,
      this.address,
      this.id,
      this.idStr,
      this.type,
      this.content,
      this.picUrls,
      this.videos,
      this.atUsers,
      this.createTime,
      this.updateTime,
      this.pushId,
      this.name,
      this.userInfoDto,
      this.avatarUrl,
      this.topics,
      this.topicsStr,
      this.picUrlsStr,
      this.videosStr,
      this.courseDto,
      this.commentCount,
      this.laudCount,
      this.shareCount,
      this.readCount,
      this.isFollow,
      this.isLaud,
      this.laudUserInfo,
      this.laudUserInfos,
      this.comments,
      this.dataState,
      this.auditState,
      this.recommendSourceDto);
}

class PicUrls {
  String url;
  int width;
  int height;
  int size;
  int createTime;

  PicUrls(this.url, this.width, this.height, this.size, this.createTime);

  PicUrls.fromJson(Map<String, dynamic> json){
    url = json["url"];
    width = json["width"];
    height = json["height"];
    size = json["size"];
    createTime = json["createTime"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["url"] = url;
    map["width"] = width;
    map["height"] = height;
    map["size"] = size;
    map["createTime"] = createTime;
    return map;
  }

  @override
  String toString() {
    return toJson().toString();
  }
}

class Videos{
  String url;
  String hlsUrl;
  int duration;
  String coverUrl;
  int width;
  int height;
  double offsetRatioX;
  double offsetRatioY;
  double videoCroppedRatio;

  Videos.fromJson(Map<String, dynamic> json){
    url = json["url"];
    hlsUrl = json["hlsUrl"];
    duration = json["duration"];
    coverUrl = json["coverUrl"];
    width = json["width"];
    height = json["height"];
    offsetRatioX = json["offsetRatioX"];
    offsetRatioY = json["offsetRatioY"];
    videoCroppedRatio = json["videoCroppedRatio"];

  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["url"]=url;
    map["hlsUrl"]=hlsUrl;
    map["duration"]=duration;
    map["coverUrl"]=coverUrl;
    map["width"]=width;
    map["height"]=height;
    map["offsetRatioX"]=offsetRatioX;
    map["offsetRatioY"]=offsetRatioY;
    map["videoCroppedRatio"]=videoCroppedRatio;
    return map;
  }


  @override
  String toString() {
    return toJson().toString();
  }

  Videos(
      this.url,
      this.hlsUrl,
      this.duration,
      this.coverUrl,
      this.width,
      this.height,
      this.offsetRatioX,
      this.offsetRatioY,
      this.videoCroppedRatio);
}

class AtUsers{
  int uid;
  int index;
  int len;
  int type;

  AtUsers.fromJson(Map<String, dynamic> json){
    uid = json["uid"];
    index = json["index"];
    len = json["len"];
    type = json["type"];

  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["uid"] = uid;
    map["index"] = index;
    map["len"] = len;
    map["type"] = type;
    return map;
  }


  @override
  String toString() {
    return toJson().toString();
  }

  AtUsers(this.uid, this.index, this.len, this.type);
}

class LaudUserInfo{
  String aa="";
}

class LaudUserInfos{
  int uid;
  String avatarUri;
  String nickName;
  String description;
  String relation;
  int time;
  int remainingMuteTime;


  LaudUserInfos.fromJson(Map<String, dynamic> json){
    uid = json["uid"];
    avatarUri = json["avatarUri"];
    nickName = json["nickName"];
    description = json["description"];
    relation = json["relation"];
    time = json["time"];
    remainingMuteTime = json["remainingMuteTime"];

  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["uid"] = uid;
    map["avatarUri"] = avatarUri;
    map["nickName"] = nickName;
    map["description"] = description;
    map["relation"] = relation;
    map["time"] = time;
    map["remainingMuteTime"] = remainingMuteTime;
    return map;
  }
  @override
  String toString() {
    return toJson().toString();
  }

  LaudUserInfos(this.uid, this.avatarUri, this.nickName, this.description,
      this.relation, this.time, this.remainingMuteTime);
}

class CourseDto{
  int id;
  int type;
  String title;
  String picUrl;
  String description;
  int coachId;
  List <CoachDto> coachDto=[];
  int levelId;
  List <LevelDto> levelDto=[];
  int targetId;
  List <TargetDto> targetDto=[];
  List <PartDtos> partDtos=[];
  List <EquipmentDtos> equipmentDtos=[];
  int timens;
  int calories;
  int creatorId;
  String creatorNickname;
  int coursewareId;
  List <CoursewareDto> coursewareDtos=[];
  int bgmType;
  int piceType;
  int price;
  int state;
  int auditState;
  int practiceAmount;
  int startDate;
  int starttime;
  int endTime;
  int isBooked;
  int totalTrainingTime;
  int totalTrainingAmount;
  int totalCalories;
  int joinAmount;
  int commentCount;
  List <CommentDtoList> commentDtoList=[];
  int laudCount;
  int finishAmount;
  int dataState;
  int createTime;
  int updateTime;
  String starLive;
  String startCourse;
  int isInMyCourseList;
  int liveCourseState;
  int lastPracticeTime;
  int bookCount;
  int liveRoomCount;
  int watchCount;
  int previewingVideo;
  int color;
  int vipprice;









  CourseDto(
      this.id,
      this.type,
      this.title,
      this.picUrl,
      this.description,
      this.coachId,
      this.coachDto,
      this.levelId,
      this.levelDto,
      this.targetId,
      this.targetDto,
      this.partDtos,
      this.equipmentDtos,
      this.timens,
      this.calories,
      this.creatorId,
      this.creatorNickname,
      this.coursewareId,
      this.coursewareDtos,
      this.bgmType,
      this.piceType,
      this.price,
      this.state,
      this.auditState,
      this.practiceAmount,
      this.startDate,
      this.starttime,
      this.endTime,
      this.isBooked,
      this.totalTrainingTime,
      this.totalTrainingAmount,
      this.totalCalories,
      this.joinAmount,
      this.commentCount,
      this.commentDtoList,
      this.laudCount,
      this.finishAmount,
      this.dataState,
      this.createTime,
      this.updateTime,
      this.starLive,
      this.startCourse,
      this.isInMyCourseList,
      this.liveCourseState,
      this.lastPracticeTime,
      this.bookCount,
      this.liveRoomCount,
      this.watchCount,
      this.previewingVideo,
      this.color,
      this.vipprice);
}

class CoachDto{
  int uid;
  String phone;
  int type;
  int subType;
  String nickName;
  String avatarUri;
  int status;
  int age;
  int isPerfect;
  int isPhone;
  int isLiving;
  int relation;

  CoachDto(
      this.uid,
      this.phone,
      this.type,
      this.subType,
      this.nickName,
      this.avatarUri,
      this.status,
      this.age,
      this.isPerfect,
      this.isPhone,
      this.isLiving,
      this.relation);
}

class LevelDto{
  int id;
  int type;
  String name;
  int updateTime;
  String ename;

  LevelDto(this.id, this.type, this.name, this.updateTime, this.ename);
}

class TargetDto{
  int id;
  int type;
  String name;
  int updateTime;
  String ename;

  TargetDto(this.id, this.type, this.name, this.updateTime, this.ename);
}

class PartDtos{
  int id;
  int type;
  String name;
  int updateTime;
  String ename;

  PartDtos(this.id, this.type, this.name, this.updateTime, this.ename);
}

class EquipmentDtos{
  int id;
  String name;
  String appPicUrl;
  String terminalPicUrl;

  EquipmentDtos(this.id, this.name, this.appPicUrl, this.terminalPicUrl);
}

class CoursewareDto{

}

class CommentDtoList{

}

class RecommendSourceDto{
  int type;

  RecommendSourceDto.fromJson(Map<String, dynamic> json){
    type = json["type"];

  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["type"] = type;
    return map;
  }


  @override
  String toString() {
    return toJson().toString();
  }

  RecommendSourceDto(this.type);
}

class TopIcs {
  int id;
  String name;
  int index;
  int len;
  AvatarUrl avatarUrl;
  int dataState;

  TopIcs.fromJson(Map<String, dynamic> json){
    id = json["id"];
    name = json["name"];
    index = json["index"];
    len = json["len"];
    dataState = json["dataState"];

    if(json["avatarUrl"]!=null){
      AvatarUrl.fromJson(json["avatarUrl"]);
      avatarUrl=AvatarUrl.fromJson(json["avatarUrl"]);
     }
    }


  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["id"] = id;
    map["name"] = name;
    map["index"] = index;
    map["len"] = len;
    map["dataState"] = dataState;
    map["avatarUrl"] = avatarUrl;
    return map;
  }


  @override
  String toString() {
    return toJson().toString();
  }

  TopIcs(
      this.id, this.name, this.index, this.len, this.avatarUrl, this.dataState);
}

class AvatarUrl {
  String url;
  String hlsUrl;
  int duration;
  String coverUrl;
  int width;
  int height;
  double offsetRatioX;
  double offsetRatioY;
  double videoCroppedRatio;


  AvatarUrl.fromJson(Map<String, dynamic> json){
    url = json["url"];
    hlsUrl = json["hlsUrl"];
    duration = json["duration"];
    coverUrl = json["coverUrl"];
    width = json["width"];
    height = json["height"];
    offsetRatioX = json["offsetRatioX"];
    offsetRatioY = json["offsetRatioY"];
    videoCroppedRatio = json["videoCroppedRatio"];

  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["url"] = url;
    map["hlsUrl"] = hlsUrl;
    map["duration"] = duration;
    map["coverUrl"] = coverUrl;
    map["width"] = width;
    map["height"] = height;
    map["offsetRatioX"] = offsetRatioX;
    map["offsetRatioY"] = offsetRatioY;
    map["videoCroppedRatio"] = videoCroppedRatio;
    return map;
  }


  @override
  String toString() {
    return toJson().toString();
  }

  AvatarUrl(
      this.url,
      this.hlsUrl,
      this.duration,
      this.coverUrl,
      this.width,
      this.height,
      this.offsetRatioX,
      this.offsetRatioY,
      this.videoCroppedRatio);
}

class Comments{
  int id;
  int targetId;
  int type;
  String content;
  List <CommentsPicUrls> picUrls=[];
  int createTime;
  List <CommentsAtUsers> atUsers=[];
  int uid;
  String name;
  String avatarUrl;
  String replys;
  int replyCount;
  int laudCount;
  int isLaud;
  double top;
  int replyId;
  String replyName;
  String delete;
  int fatherTargetId;
  int fatherType;
  int auditState;
  int dataState;


  Comments.fromJson(Map<String, dynamic> json) {
    id = json["id"];
    targetId = json["targetId"];
    type = json["type"];
    content = json["content"];
    createTime = json["createTime"];
    uid = json["uid"];
    name = json["name"];
    avatarUrl = json["avatarUrl"];
    replys = json["replys"];
    replyCount = json["replyCount"];
    laudCount = json["laudCount"];

    isLaud = json["isLaud"];
    top = json["top"];
    replyId = json["replyId"];
    replyName = json["replyName"];
    delete = json["delete"];
    fatherTargetId = json["fatherTargetId"];
    fatherType = json["fatherType"];
    auditState = json["auditState"];
    dataState = json["dataState"];

    if(json["picUrls"]!=null){
      json["picUrls"].forEach((v){
        if(v is CommentsPicUrls){
          picUrls.add(v);
        }else{
          picUrls.add(CommentsPicUrls.fromJson(v));
        }
      });
    }

    if(json["atUsers"]!=null){
      json["atUsers"].forEach((v){
        if(v is CommentsAtUsers){
          atUsers.add(v);
        }else{
          atUsers.add(CommentsAtUsers.fromJson(v));
        }
      });
    }

  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["id"]=id;
    map["targetId"]=targetId;
    map["type"]=type;
    map["content"]=content;
    map["createTime"]=createTime;
    map["uid"]=uid;
    map["name"]=name;
    map["avatarUrl"]=createTime;
    map["replys"]=avatarUrl;
    map["replyCount"]=replys;
    map["laudCount"]=replyCount;
    map["isLaud"]=isLaud;
    map["top"]=top;
    map["replyId"]=replyId;
    map["replyName"]=replyName;
    map["delete"]=delete;
    map["fatherTargetId"]=fatherTargetId;
    map["fatherType"]=fatherType;
    map["auditState"]=auditState;
    map["dataState"]=dataState;
    map["picUrls"]=picUrls;
    map["atUsers"]=atUsers;
    return map;
  }


  @override
  String toString() {
    return toJson().toString();
  }

  Comments(
      this.id,
      this.targetId,
      this.type,
      this.content,
      this.picUrls,
      this.createTime,
      this.atUsers,
      this.uid,
      this.name,
      this.avatarUrl,
      this.replys,
      this.replyCount,
      this.laudCount,
      this.isLaud,
      this.top,
      this.replyId,
      this.replyName,
      this.delete,
      this.fatherTargetId,
      this.fatherType,
      this.auditState,
      this.dataState);
}


class CommentsPicUrls {
  String url;
  double width;
  double height;
  int size;
  int createTime;

  CommentsPicUrls(this.url, this.width, this.height, this.size, this.createTime);

  CommentsPicUrls.fromJson(Map<String, dynamic> json){
    url = json["url"];
    width = json["width"];
    height = json["height"];
    size = json["size"];
    createTime = json["createTime"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["url"] = url;
    map["width"] = width;
    map["height"] = height;
    map["size"] = size;
    map["createTime"] = createTime;
    return map;
  }

  @override
  String toString() {
    return toJson().toString();
  }
}

class CommentsAtUsers{
  int uid;
  int index;
  int len;
  int type;

  CommentsAtUsers.fromJson(Map<String, dynamic> json){
    uid = json["uid"];
    index = json["index"];
    len = json["len"];
    type = json["type"];

  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["uid"] = uid;
    map["index"] = index;
    map["len"] = len;
    map["type"] = type;
    return map;
  }


  @override
  String toString() {
    return toJson().toString();
  }

  CommentsAtUsers(this.uid, this.index, this.len, this.type);
}



